﻿<phone:PhoneApplicationPage 
    xmlns:local="clr-namespace:MTGScore"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="MTGScore.DicePage"
    xmlns:c4fToolkit="clr-namespace:Coding4Fun.Phone.Controls.Toolkit;assembly=Coding4Fun.Phone.Controls.Toolkit"
    xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" Loaded="DicePage_Loaded">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="MTG Score" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Path=Strings.DiceSimulation, Source={StaticResource LocalizedStrings }}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="137*" />
                <RowDefinition Height="60*" />
                <RowDefinition Height="60*" />
                <RowDefinition Height="134*" />
                <RowDefinition Height="103*" />
                <RowDefinition Height="113*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="160*" />
                <ColumnDefinition Width="160*" />
                <ColumnDefinition Width="160*" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="2" Grid.Column="0" Height="40" HorizontalAlignment="Stretch" Name="TypeChooserText_1" Text="{Binding Path=Strings.DiceType1, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Center" Width="152" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" >
                <toolbox:GestureService.GestureListener>
                    <toolbox:GestureListener Tap="TapDice1_Tap" />
                </toolbox:GestureService.GestureListener>
            </TextBlock>
            <TextBlock Grid.Row="2" Grid.Column="1" Height="40" HorizontalAlignment="Stretch" Name="TypeChooserText_All" Text="{Binding Path=Strings.EitherType, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Center" Width="152" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" >
                <toolbox:GestureService.GestureListener>
                    <toolbox:GestureListener Tap="TapDiceAll_Tap" />
                </toolbox:GestureService.GestureListener>
            </TextBlock>
            <TextBlock Grid.Row="2" Grid.Column="2" Height="40" HorizontalAlignment="Stretch" Name="TypeChooserText_2" Text="{Binding Path=Strings.DiceType2, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Center" Width="152" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center"  >
                <toolbox:GestureService.GestureListener>
                    <toolbox:GestureListener Tap="TapDice2_Tap" />
                </toolbox:GestureService.GestureListener>
            </TextBlock>
            
            <!--
            
                        <TextBlock Grid.Row="2" Grid.Column="0" Height="40" HorizontalAlignment="Stretch" Name="TypeChooserText_1" Text="Scegli il dado" VerticalAlignment="Center" Width="152" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" MouseLeftButtonDown="TypeChooserText_1_MouseLeftButtonDown" />
            <TextBlock Grid.Row="2" Grid.Column="1" Height="40" HorizontalAlignment="Stretch" Name="TypeChooserText_All" Text="Scegli dadi" VerticalAlignment="Center" Width="152" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" MouseLeftButtonDown="TypeChooserText_All_MouseLeftButtonDown"/>
            <TextBlock Grid.Row="2" Grid.Column="2" Height="40" HorizontalAlignment="Stretch" Name="TypeChooserText_2" Text="Scegli il dado" VerticalAlignment="Center" Width="152" FontSize="24" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" MouseLeftButtonDown="TypeChooserText_2_MouseLeftButtonDown" />
            
            -->

            <!--<Button Content="{Binding Path=Strings.Rolls1, Source={StaticResource LocalizedStrings }}" Grid.Row="4" Height="99" HorizontalAlignment="Left" Name="Dice_1" VerticalAlignment="Stretch" Width="152" Click="Dice_1_Click"/>
            <Button Content="{Binding Path=Strings.Rolls2, Source={StaticResource LocalizedStrings }}" Grid.Row="4" Grid.Column="2" Height="99" HorizontalAlignment="Stretch" Name="Dice_2" VerticalAlignment="Stretch" Width="152" Click="Dice_2_Click" />
            <Button Content="{Binding Path=Strings.Either, Source={StaticResource LocalizedStrings }}" Grid.Row="4" Grid.Column="1" Height="99" HorizontalAlignment="Stretch" Name="Dice_All" VerticalAlignment="Stretch" Width="152" Click="Dice_All_Click"/>-->

            <Button Content="{Binding Path=Strings.Rolls1, Source={StaticResource LocalizedStrings }}" Grid.Row="4" HorizontalAlignment="Stretch" Name="Dice_1" VerticalAlignment="Stretch" Click="Dice_1_Click"/>
            <Button Content="{Binding Path=Strings.Rolls2, Source={StaticResource LocalizedStrings }}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Stretch" Name="Dice_2" VerticalAlignment="Stretch" Click="Dice_2_Click" />
            <Button Content="{Binding Path=Strings.Either, Source={StaticResource LocalizedStrings }}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Stretch" Name="Dice_All" VerticalAlignment="Stretch" Click="Dice_All_Click"/>

            <TextBlock Grid.Row="3" Height="125" HorizontalAlignment="Stretch" Name="Result_1" Text="99" VerticalAlignment="Center" Width="152" FontSize="72" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" Margin="0,24,0,0" />
            <TextBlock Grid.Row="3" Grid.Column="2" Height="125" HorizontalAlignment="Stretch" Name="Result_2" Text="99" VerticalAlignment="Center" Width="152" FontSize="72" FontStretch="Expanded" FontWeight="Normal" TextAlignment="Center" Margin="0,24,0,0" />

            <Border Name="DiceBorder1" BorderThickness="3" Padding="6" Grid.Row="1" Grid.Column="0">
                <toolbox:GestureService.GestureListener>
                    <toolbox:GestureListener Tap="GestureListener_Tap" />
                </toolbox:GestureService.GestureListener>
                <toolbox:ContextMenuService.ContextMenu>
                    <toolbox:ContextMenu>
                        <toolbox:MenuItem Header="4" Click="Type1_Click" />
                        <toolbox:MenuItem Header="6" Click="Type1_Click" />
                        <toolbox:MenuItem Header="10" Click="Type1_Click" />
                        <toolbox:MenuItem Header="12" Click="Type1_Click" />
                        <toolbox:MenuItem Header="20" Click="Type1_Click" />
                        <toolbox:MenuItem Header="100" Click="Type1_Click" />
                    </toolbox:ContextMenu>
                </toolbox:ContextMenuService.ContextMenu>
                <TextBlock Name="DiceTypeText1" Text="20"  FontSize="26" TextAlignment="Center"/>
            </Border>

            <Border Name="DiceBorderAll" BorderThickness="3" Padding="6" Grid.Row="1" Grid.Column="1">
                <toolbox:GestureService.GestureListener>
                    <toolbox:GestureListener Tap="GestureListener_Tap" />
                </toolbox:GestureService.GestureListener>
                <toolbox:ContextMenuService.ContextMenu>
                    <toolbox:ContextMenu>
                        <toolbox:MenuItem Header="4" Click="TypeAll_Click" />
                        <toolbox:MenuItem Header="6" Click="TypeAll_Click" />
                        <toolbox:MenuItem Header="10" Click="TypeAll_Click" />
                        <toolbox:MenuItem Header="12" Click="TypeAll_Click" />
                        <toolbox:MenuItem Header="20" Click="TypeAll_Click" />
                        <toolbox:MenuItem Header="100" Click="TypeAll_Click" />
                    </toolbox:ContextMenu>
                </toolbox:ContextMenuService.ContextMenu>
                <TextBlock  Name="DiceTypeTextAll" Text="20"  FontSize="26" TextAlignment="Center"/>
            </Border>

            <Border Name="DiceBorder2" BorderThickness="3" Padding="6" Grid.Row="1" Grid.Column="2">
                <toolbox:GestureService.GestureListener>
                    <toolbox:GestureListener Tap="GestureListener_Tap" />
                </toolbox:GestureService.GestureListener>
                <toolbox:ContextMenuService.ContextMenu>
                    <toolbox:ContextMenu>
                        <toolbox:MenuItem Header="4" Click="Type2_Click" />
                        <toolbox:MenuItem Header="6" Click="Type2_Click" />
                        <toolbox:MenuItem Header="10" Click="Type2_Click" />
                        <toolbox:MenuItem Header="12" Click="Type2_Click" />
                        <toolbox:MenuItem Header="20" Click="Type2_Click" />
                        <toolbox:MenuItem Header="100" Click="Type2_Click" />
                    </toolbox:ContextMenu>
                </toolbox:ContextMenuService.ContextMenu>
                <TextBlock  Name="DiceTypeText2" Text="20"  FontSize="26" TextAlignment="Center"/>
            </Border>
            
            <Grid Name="AdControl1" xmlns:adctl="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" Grid.Row="0" Grid.ColumnSpan="3" >
                <adctl:AdControl Height="80" Width="480" AdUnitId="32126" ApplicationId="b76d31a7-58ed-4379-bf66-a32f00905f2d" AdModel="Contextual"  AdControlError="AdControl_AdControlError" Margin="-12,0,-12,35" />
            </Grid>
            <Grid Name="AdControl2" xmlns:adctl="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" Grid.Row="5" Grid.ColumnSpan="3">
                <adctl:AdControl Height="80" Width="480" AdUnitId="32126" ApplicationId="b76d31a7-58ed-4379-bf66-a32f00905f2d" AdModel="Contextual" AdControlError="AdControl_AdControlError" Margin="-12,0,-12,33" />
            </Grid>
        </Grid>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
